package com.wxzhou.wangzhuan.entity;

public enum ButieType {
    BUTIE_DEFAULT(1, "N到M之间的随机值"),
    BUTIE_WITH_AD(2, "实际收益+N到M之间的随机值");

    private final int code;
    private final String description;

    ButieType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static ButieType fromCode(int code) {
        for (ButieType channel : ButieType.values()) {
            if (channel.getCode() == code) {
                return channel;
            }
        }
        throw new IllegalArgumentException("Unknown ButieType code: " + code);
    }

    @Override
    public String toString() {
        return description;
    }

}
